In a known technique for obtaining a tilt angle of a document in an image-reading device, the image-reading device detects a position of an edge of a document in read data obtained by reading the document and obtains a tilt angle of the document based on the detected edge position. For example, while moving a detection line from one side to the other side along a main-scanning direction, the image-reading device repeatedly detects, on the detection line extending along a sub-scanning direction, a candidate edge point having a pixel value that is different from a pixel value of pixels surrounding the candidate edge point by a threshold value or greater. Then, the image-reading device obtains an approximate straight line based on the detected candidate edge points to obtain a tilt angle of the document and determines the obtained tilt angle of the document as a detection result.